import {Component, OnInit} from '@angular/core';
import {ControlUIWidget, SFCustomWidgetSchema} from '@delon/form';


export interface SysRegionSelectAlainSchema extends SFCustomWidgetSchema {
    showProvince?: boolean;
    showCity?: boolean;
    showDistrict?: boolean;
    showStreet?: boolean;
    showCun?: boolean;
    showGroup?: boolean;
    /**
     * 每一个选择框的占用情况
     */
    eachWidth?: string;
    /**
     * 在最上层的过滤条件
     * 默认为：100000
     * 例如省级的上一层为国家：100000
     */
    aboveTopLevelCode?: string;

    valueChange?: (value: string | string[] | object) => any;

    valueType?: 'string' | 'array' | 'object';
}


@Component({
    selector: 'sys-region-select-alain',
    templateUrl: './sys-region-select-alain.component.html',
    styleUrls: ['./sys-region-select-alain.component.less']
})
export class SysRegionSelectAlainComponent extends ControlUIWidget<SysRegionSelectAlainSchema> implements OnInit {
    /* 用于注册小部件 KEY 值 */
    static readonly KEY = 'sys-region-select-alain';

    selectedValue: any;

    ngOnInit(): void {
    }

    reset(_value: any): void {
        this.selectedValue = _value;
    }
}
